package org.example.springoauth2.resourceserver2.feign.factory;

import org.example.springoauth2.resourceserver2.feign.RemoteResourceServer1HomeService;
import org.example.springoauth2.resourceserver2.feign.factory.fallback.RemoteResourceServer1HomeServiceImpl;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author hzq
 * @date 2021/10/12 13:43
 */
@Component
public class RemoteResourceServer1HomeFallbackFactory implements FallbackFactory<RemoteResourceServer1HomeService> {

    @Override
    public RemoteResourceServer1HomeService create(Throwable cause) {
        RemoteResourceServer1HomeServiceImpl remoteResourceServer1HomeService = new RemoteResourceServer1HomeServiceImpl();
        remoteResourceServer1HomeService.setCause(cause);
        return remoteResourceServer1HomeService;
    }
}
